import { https } from '@/utils/http.js'

export const makeRequest = (url:string, data = {}, method:string) => {
      const queryParams = new URLSearchParams(data).toString();
      //   return https.post(`${url}?${queryParams}`, null, config); // query 参数放在 URL 中
      // 判断请求方式
      if (method === 'GET') {
            console.log('进入get亲求',method)
            return https.get(`${url}?${queryParams}`)
      } else {
            console.log('进入postg亲求',method)
            return https.post(`${url}?${queryParams}`)
      }
};



// query传参方法
//POST传参
// axios.post('https://geek.itheima.net/v1_0/articles', {
//       data: { /* 这是请求体内容 */ }
//     }, {
//       params: { channel_id: 0, timestamp: 1741103152977 }
//     })
//GET传参
// axios.get('https://geek.itheima.net/v1_0/articles', {
//       params: { channel_id: 0, timestamp: 1741103152977 }
//     })
    